<?php
namespace php\widgets\editorxml;
use yii\helpers\Html;
class WebLayoutWidget extends WebWidget{
	public function run(){
		if(empty($this->value['value'])) return null;

		LayoutAsset::register($this->view);
		
		$options = $this->options;
		$shtml = Html::beginTag('div', $options);
		$shtml .= '<div class="row">';
		foreach ($this->value['value'] as $key => $val) {

			$shtml .= '<div class="col-xs-'.$val['col'].'">';

			if(!empty($this->value['childs'][$key])){
				foreach ($this->value['childs'][$key] as $k => $v) {
					$shtml .= $this->that->renderWidget($v);
				}
			}
			$shtml .= '</div>';
		}
		$shtml .= '</div>';
		$shtml .= Html::endTag('div');
		return $shtml;
	}
}